package com.chinasoft.maysham.manager.controller.project;

import com.chinasoft.maysham.manager.controller.BaseController;
import com.chinasoft.maysham.manager.model.ProjectUser;
import com.chinasoft.maysham.manager.request.InviteReq;
import com.chinasoft.maysham.manager.service.project.ProjectUserService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/projects/users")
public class ProjectUserController extends BaseController {

    @Resource
    private ProjectUserService projectUserService;

    @PostMapping("/invite")
    public ProjectUser invite(@RequestBody InviteReq inviteReq){
        return projectUserService.invite(inviteReq, currentUserId());
    }
}
